export default (url) => {
  const crud = window.$crud(url);
  const getListProjectId = (params) =>
    window.$axios({
      url: `${url}s`,
      method: "get",
      params,
      meta: {
        hasProjectId: true,
      },
    });
  const removeProjectId = (id) =>
    window.$axios({
      url: `${url}/${id}`,
      method: "delete",
      meta: {
        hasProjectId: true,
      },
    });

  const updateProjectId = (id, data) =>
    window.$axios({
      url: `${url}/${id}`,
      method: "put",
      data,
      meta: {
        hasProjectId: true,
      },
    });

  const addProjectId = (data) =>
    window.$axios({
      url: `${url}`,
      method: "post",
      data,
      meta: {
        hasProjectId: true,
      },
    });

  return {
    ...crud,
    getListProjectId,
    removeProjectId,
    updateProjectId,
    addProjectId,
  };
};
